<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>运营平台</title>

   <import type="css" basepath="__CSS__" file="bootstrap" />
	<import type="css" basepath="__CSS__" file="datetimepicker" />
	<import type="css" basepath="__CSS__" file="fontawesome" />
	<import type="css" basepath="__CSS__" file="fonts" />
	<import type="css" basepath="__CSS__" file="bootgrid" />
	<import type="css" basepath="__CSS__" file="style" />
</head>

<body>
<div class="topNav">
    <span class="text"><i class="iconfont">&#xe607;</i><a href="/main" target="rightFrame">首页</a>&gt;<span>商家管理</span>&gt;<span>商家商品</span></span>
	 <!-- <form method="post" action="{:U('Pro/index')}">
    <div class="input-group">
        <span class="input-group-addon btn search-font"><i class="fa fa-search"></i></span>
        <input type="text" class="form-control input-lg search-color" placeholder="请输入商品名称" style="font-size:85%;"/>
    </div>
	 </form>-->
</div>

<div class="contain">
    <div class="pageTitle">
        <h2 class="title">检索结果</h2>
    </div>
    <div class="tableBoxOne">
        <div class="scroll">
            <table id="grid" class="table table-bordered" data-selection="false" data-multi-select="false" data-row-select="false" data-keep-selection="false">
                <thead>
                <tr>
                    <th data-column-id="01" data-width="180" >商家名</th>
                    <th data-column-id="02" data-width="120" >商品编号</th>
                    <th data-column-id="03" data-width="150" >商品名称</th>
                    <th data-column-id="04" data-width="150"  data-formatter="businessImg" data-sortable="true">商品图片</th>
                    <th data-column-id="05" data-width="100">商品分类</th>
                    <th data-column-id="06" data-width="120">价格</th>
                    <th data-column-id="07" data-width="120">添加时间</th>
                    <th data-column-id="08" data-width="120">总销量</th>
                    <th data-column-id="09" data-width="120">简介</th>
                    <th data-column-id="11" data-width="120"  data-formatter="businessGoodsSale" data-sortable="true">操作</th>
                </tr>
                </thead>
                <tbody>
                <foreach name="list" item="item" >
                <tr>
                    <td>{$item.id}</td>
                    <td>{$item.shop_name}</td>
                    <td>{$item.pro_name}</td>
                    <td><img src="{$item.pic_path}"></td> 
                    <td>{$item.class_name}</td>
                    <td>￥{$item.price}</td>
                    <td>{$item.add_time|date='Y-m-d',###}</td>
                    <td>{$item.salenum}</td>
                    <td>{$item.introduce}</td>
                    <td><a class='xj' cid='{$item.id}' state="{$item.is_home}"><if condition="$item.is_home eq 0 ">下架<else/>上架</if></a></td>
                </tr>
               </foreach>
                </tbody>
            </table>
			   {$page}
        </div>
    </div>
</div>

<script src="/App/Admin/public/js/jquery-2.1.1.min.js"></script>
<script src="/App/Admin/public/js/bootstrap.min.js"></script>
<script src="/App/Admin/public/js/jquery.datetimepicker.js"></script>
<script src="/App/Admin/public/js/jquery.bootgrid.min.js"></script>
<script src="/App/Admin/public/js/jquery.bootgrid.fa.min.js"></script>
<script src="/App/Admin/public/js/time.js"></script>





<script>
$('.xj').click(function(){
    var t=$(this);
    var text=$(this).html();
    var mymessage=confirm("你确定"+text+"此商品");  
    if(mymessage==true)  
    {  
        var state=$(this).attr("state");
        var cid=$(this).attr("cid");
      
	 /* if(state==1){
        $(this).attr("state","0");
        state=0;
       }else{
        $(this).attr("state","1");
        state=1;
       }*/
	   
        $.get('{:U('Product/editHome')}',{cid:cid,state:state},function(data){
            if(data==100){
               if(text=="上架"){
                    t.html("下架");
               }else{
                    t.html("上架");

               }
			   location.reload();
            }
        })
    }  
    else if(mymessage==false)  
    {  
        
    }     
})
</script>
</body>
</html>